// radiates a field

// 0 - field type
// 1 - radius
// 2 - duration, leave at 0 to default to 3
// 3,4 - the flag. if 1, does radiate

beginobjectscript; // talking object

variables;
	short last_abil;
short effect_type;
short duration;

body;

beginstate INIT_STATE;
	set_obj_act_at_dist(ME,1);
	last_abil = get_current_tick();
	break;

beginstate DEAD_STATE;
	break;

beginstate START_STATE; 
	if (get_memory_cell(3) != 0) {
		if (gf(get_memory_cell(3),get_memory_cell(4)) == 0)
			end();
		}
	if (tick_difference(last_abil,get_current_tick()) > 0) {
		last_abil = get_current_tick();
		
		duration = 3;
		if (get_memory_cell(1) != 0)
			duration = get_memory_cell(2);
		if (is_town())
			duration = 3;
		radiate_ground_effect(my_loc_x(),my_loc_y(),get_memory_cell(0),duration,get_memory_cell(1));

			
		}
	break;

beginstate USE_STATE;
break;
